﻿//用户
function alertWindow(text) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectUser.aspx?TableName=ERPUser&LieName=UserName&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var RadNum = Math.random();
        var wName = window.showModalDialog('../Main/SelectUser.aspx?TableName=ERPUser&LieName=UserName&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {
        } else {
            document.getElementById('' + text + '').value = wName;
        }
    }
}
function callbackchild(wame, text) {
    document.getElementById('' + text + '').value = wame;
}


//字典
function alertSelectCondition(text, TableName, LieName) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectCondition.aspx?TableName=" + TableName +"&LieName=" + LieName + "&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {
        var wName;
        var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectCondition.aspx?TableName=' + TableName + '&LieName=' + LieName + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {
        } else {
            document.getElementById('' + text + '').value = wName;
        }
    }
}
function backSelectCondition(cname, ctext) {
    document.getElementById('' + ctext + '').value = cname;
}

//字典1 
function alertGetSelectCondition(text, TableName, LieName) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectCondition.aspx?GetTable=ERPCrmSetting&TableName=" + TableName + "&LieName=" + LieName + "&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var wName;
        var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectCondition.aspx?GetTable=ERPCrmSetting&TableName=' + TableName + '&LieName=' + LieName + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {

        } else {
            document.getElementById('' + text + '').value = wName;
        }
 
    }
}
//字典1通用
function alertCondition(text, TableName, LieName, type, GetTable) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectCondition.aspx?GetType=" + type + "&GetTable=" + GetTable + "&TableName=" + TableName + "&LieName=" + LieName + "&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var wName;
        var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectCondition.aspx?GetType=' + type+'&GetTable=' + GetTable+'&TableName=' + TableName + '&LieName=' + LieName + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {

        } else {
            document.getElementById('' + text + '').value = wName;
        }

    }
}

//字典2
function alertSelectValue(text, TableName, LieName) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectCondition.aspx?TableName=" + TableName + "&LieName=" + document.getElementById('' + LieName+'').value +"&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var wName;
        var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectCondition.aspx?TableName=' + TableName + '&LieName=' + document.getElementById('' + LieName + '').value + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {

        } else {
            document.getElementById('' + text + '').value = wName;
        }

    }
}
//字典二通用
function alertValue(text, TableName, LieName, type, TableName) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectCondition.aspx?GetType=" + type + "&TableName=" + TableName + "&LieName=" + document.getElementById('' + LieName + '').value + "&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var wName;
        var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectCondition.aspx?GetType=' + type + '&TableName=' + TableName + '&LieName=' + document.getElementById('' + LieName + '').value + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {

        } else {
            document.getElementById('' + text + '').value = wName;
        }

    }
}


//综合
function alertWork(text,url, LieName, TableName) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/" + url+"?TableName=" + TableName+"&LieName=" + LieName + "&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var RadNum = Math.random();
        var wName = window.showModalDialog('../Main/' + url+'?TableName=' + TableName + '&LieName=' + LieName + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {
        } else {
            document.getElementById('' + text + '').value = wName;
        }
    }
}
function callbackchild(wame, text) {
    document.getElementById('' + text + '').value = wame;
}



//部门
function alertDanWei(text) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectDanWei.aspx?TableName=ERPBuMen&LieName=BuMenName&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {


        var wName; var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectDanWei.aspx?TableName=ERPBuMen&LieName=BuMenName&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {
        } else {
            document.getElementById('' + text + '').value = wName;
        }
 
    }
}
function callbackDanWei(wame, text) {
    document.getElementById('' + text + '').value = wame;
}


//工作流
function alertSelectJieDian(text,WorkFlowID) {
    if (window.showModalDialog == undefined) {
        window.open("../Main/SelectJieDian.aspx?WorkFlowID=" + WorkFlowID + "&TextBox=" + text + "&Radstr=" + RadNum, "_blank",
            "width=" + 450 + ",height=" + 400 + ",scroll=0,top=" + screen.availWidth / 8 + ", left=" + screen.availHeight / 2 + ",");
    } else {

        var wName;
        var RadNum = Math.random();
        wName = window.showModalDialog('../Main/SelectJieDian.aspx?WorkFlowID=' + WorkFlowID + '&Radstr=' + RadNum, '', 'dialogWidth:350px;DialogHeight=400px;status:no;help:no;resizable:yes;');
        if (wName == null) {
        } else {
            document.getElementById('' + text + '').value = wName;
        }

    }
}
function callbackSelectJieDian(wame, text) {
    document.getElementById('' + text + '').value = wame;
}
